<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title a m-cf">加盟申请</div>
                </div>

                <!-- 工具栏 -->
                <div class="page_toolbar am-margin-bottom am-cf">
                    <form class="toolbar-form" action="">
                        <input type="hidden" name="s" value="/<?= $request->pathinfo() ?>">
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a class="j-export am-btn am-btn-success am-radius"
                                       href="javascript:void(0);">
                                        <i class="iconfont icon-daochu am-margin-right-xs"></i>数据导出
                                    </a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="widget-body am-fr">
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>id</th>
                                <th>加盟品牌</th>
                                <th>加盟地址</th>
                                <th>姓名</th>
                                <th>身份证号</th>
                                <th>身份证正面</th>
                                <th>身份证反面</th>
                                <th>手机号</th>
                                <th>年龄</th>
                                <th>订单号</th>
                                <th>价格(元)</th>
                                <th>是否支付</th>
                                <th>支付时间</th>
                                <th>创建时间</th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle"><?= $item['Brand'] ?></td>
                                    <td class="am-text-middle"><?= $item['address'] ?></td>
                                    <td class="am-text-middle"><?= $item['name'] ?></td>
                                    <td class="am-text-middle"><?= $item['idcard'] ?></td>
                                    <td class="am-text-middle"><a href="<?= $item['idcard_file1'] ?>" target="_blank"><img src="<?= $item['idcard_file1'] ?>" style="width:50px"/></a> </td>
                                    <td class="am-text-middle"><a href="<?= $item['idcard_file2'] ?>" target="_blank"><img src="<?= $item['idcard_file2'] ?>" style="width:50px"/></a> </td>
                                    <td class="am-text-middle"><?= $item['phone'] ?></td>
                                    <td class="am-text-middle"><?= $item['age'] ?></td>
                                    <td class="am-text-middle"><?= $item['order_num'] ?></td>
                                    <td class="am-text-middle"><?= $item['price'] ?></td>
                                    <td class="am-text-middle"><?= $item['is_pay'] ? '<span style="color:#f00">是</span>' : '否' ?></td>
                                    <td class="am-text-middle"><?= $item['pay_time'] ?></td>
                                    <td class="am-text-middle"><?= $item['create_time'] ?></td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="14" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {

        // 删除元素
        var url = "<?= url('shop/delete') ?>";
        $('.item-delete').delete('shop_id', url, '删除后不可恢复，确定要删除吗？');


        /**
         * 订单导出
         */
        $('.j-export').click(function () {
            var data = {};
            var formData = $('#form-search').serializeArray();
            $.each(formData, function () {
                this.name !== 's' && (data[this.name] = this.value);
            });
            window.location = "<?= url('join.address/export') ?>" + '&' + $.urlEncode(data);
        });
    });
</script>

